﻿import os
import sys

from PyQt5 import QtCore, QtGui
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtQml import QQmlApplicationEngine, qmlRegisterType
from PyQt5.QtCore import QObject, pyqtSlot, pyqtSignal, pyqtProperty

from mymodel import MyModel

if __name__ == '__main__':
    app = QGuiApplication(sys.argv)

    qmlRegisterType(MyModel,'MyModel',1,0,'MyModel')
    
    model = MyModel()
    engine = QQmlApplicationEngine()
    engine.rootContext().setContextProperty("myModel", model)
    engine.load('main.qml')

    sys.exit(app.exec())